<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{width: 200px;height: 200px;background-color: paleturquoise;color: palevioletred;border: 10px solid pink;}
    </style>
</head>
<body>
    <div>鼠标移入改变样式,鼠标移出恢复</div>
</body>
<script>
    let div=document.querySelector("div")
    div.addEventListener("mouseover",function(e){
        div.style.backgroundColor="pink"
        div.style.borderColor="paleturquoise"
        div.style.color="paleturquoise"
        div.style.cursor="crosshair"
    })
    div.addEventListener("mouseout",function(e){
        div.style=""
    })
</script>
</html>